import menuMap from '@/menu/role-menu-map';
import * as _ from 'lodash';

var globalMixin = {

    methods: {
        //依赖角色加载 -- 登录后与刷新后需要重新载入
        addMenuList(role) {
            if (_.isEmpty(this.$store.state.base.menuList)) {
                let menuList = menuMap.getRoleMenu(role);
                console.log(11,menuList);
                this.$store.dispatch('addMenulist', menuList);
            }
        }
    }
};

export default globalMixin;
